package com.molichuxing.services.property;

/**
 * @Author: renzhengyu
 * @Description:
 * @Date: Created in 14:44 2019/8/13
 * @Modified By:
 **/
public enum OrderDealerSendCarStatusEnum {
    /**
     * 未发车
     */
    NO_SEND(1, "未发车"),

    /**
     * 拒收车
     */
    REJECTION(2,"拒收车"),

    /**
     * 未收车
     */
    NO_RECEIVED(3,"未收车"),

    /**
     * 已收车
     */
    RECEIVED(4,"已收车");

    int value;
    String name;

    OrderDealerSendCarStatusEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    /**
     * 通过value获取枚举的name
     * @param value
     * @return
     */
    public static String getName(int value) {
        for (OrderDealerSendCarStatusEnum sendCarStatus : OrderDealerSendCarStatusEnum.values()) {
            if (sendCarStatus.getValue() == value) {
                return sendCarStatus.name;
            }
        }
        return null;
    }
}
